<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%--日期格式化--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>首页</title>
    <meta name="keywords" content="课程学习问答系统">
    <meta name="description" content="课程学习问答系统">
    <script src="../static/js/jquery/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="../static/layui/layui.js" type="text/javascript"></script>
    <script src="../static/js/index/index.js" type="text/javascript"></script>
    <script src="../static/js/index/freezeheader.js" type="text/javascript"></script>
    <script src="../static/layui/lay/modules/layer.js" type="text/javascript"></script>
    <script src="../static/js/index/sliders.js" type="text/javascript"></script>
    <script src="../static/js/index/html5.js" type="text/javascript"></script>
    <link rel="stylesheet" href="../static/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../static/layui/css/modules/layer/default/layer.css"/>
    <link rel="stylesheet" href="../static/css/global.css"/>

    <!--
    -->
</head>
<body>
<div class="layui-header header">
    <div class="main">
        <ul class="layui-nav layui-nav-left" lay-filter="filter">

            <%--  <a class="logo" href="index.html" title="课程学习问答系统"> <img src="../static/images/logo1.png"/></a>--%>
            <img src="/static/images/logo1.png"/>
            <li class="layui-nav-item  nav-left">
                <a href="/teacher/">首页</a>
            </li>
            <li class="layui-nav-item">
                <a href="/teacher/outArticle">发表文章</a>
            </li>
            <li class="layui-nav-item">
                <a href="/teacher/article">文章库</a>
            </li>

        </ul>
        <ul class="layui-nav layui-layout-right layui-nav-right" lay-filter="filter">

            <li class="layui-nav-item">

                <a href="/teacher/question">我的
                    <c:set var="flag4" value="${FLAG}"></c:set>
                    <c:if test="${flag4!=0}">
                        <span class="layui-badge-dot"></span>
                    </c:if>
                </a>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;"><img src="/static/images/head.jpg" class="layui-nav-img">个人中心</a>
                <dl class="layui-nav-child">
                    <dd><a href="/teacher/set">查看个人资料</a></dd>
                    <dd><a href="/teacher/logout">退出</a></dd>
                </dl>
            </li>
        </ul>
    </div>
</div>

<div class="layui-container container">
    <form class="layui-form" method="get" action="/teacher/questionSearch">
        <div class="layui-form-item">
            <label class="layui-form-label">筛选条件</label>
            <div class="layui-input-inline">
                <%-- 筛选出科目--%>
                <select name="questionSubject" lay-filter="questionSubject">
                    <option value="-1">请选择科目</option>

                    <c:forEach var="subject" items="${subject}">
                        <option value="${subject}">${subject}</option>
                    </c:forEach>
                </select>
            </div>
            <div class="layui-input-inline">
                <%--筛选出章节--%>
                <select name="questionSection" lay-filter="questionSection">
                    <option value="-1">请选择章节</option>
                    <c:forEach var="section" items="${section}">
                        <option value="${section}">${section}</option>
                    </c:forEach>
                </select>
            </div>

            <button class="layui-btn" lay-filter="*" lay-submit>筛选</button>

        </div>

    </form>
    <div class="layui-row layui-col-space20">
        <div class="layui-col-md8">
            <div class="article-main">
                <h2>
                    问题列表
                </h2>


                <ul>
                    <c:forEach items="${questions}" var="question">
                        <c:set var="flag" value="${question.questionIsAnswer}"></c:set>
                        <div class="article-list">
                            <li>

                                <p>
                                    <c:if test="${flag==1}">
                                    <a href="/teacher/questionOne/${question.questionId}">问题:${question.questionText}...</a>
                                    <b style="float: right;">
                                        <em style="color:#999">[已回复]</em>
                                        <fmt:formatDate
                                                value="${question.questionTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                    </b>
                                    </c:if>
                                    <c:if test="${flag==0}">
                                <p>
                                    <span>问题:${question.questionText}...</span>
                                    <b style="float: right;">
                                        <em style="color:#999">[未回复]</em>
                                        <fmt:formatDate
                                                value="${question.questionTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                    </b>
                                </p>
                                </c:if>

                            </li>
                        </div>

                    </c:forEach>

                </ul>


            </div>
            <!--分页-->
            <%--  <div id="page"></div>--%>
        </div>
        <div class="layui-col-md4">
            <form class="layui-form" method="get" action="/teacher/search">
                <div class="layui-form-item">
                    <div class="layui-input-inline" style="width:70%;">
                        <input type="text" name="keyContent" lay-verify="required" placeholder="请输入关键字"
                               class="layui-input">
                    </div>
                    <button class="layui-btn" lay-filter="*" lay-submit>搜索</button>
                </div>
            </form>
            <div class="ad"><img lay-src="../static/images/ad.jpg"></div>
            <div class="ms-top">
                <ul class="hd" id="tab">
                    <li class="cur"><a>最近热题</a></li>

                </ul>
            </div>
            <div class="ms-main" id="ms-main">
                <div style="display: block;" class="bd bd-news">
                    <ul>
                        <c:forEach var="questionComment" items="${questionsByCommentSum}">
                            <li>
                                <a href="/teacher/questionOne/${questionComment.questionId}">${questionComment.questionText}</a>
                            </li>
                        </c:forEach>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<%@ include file="footer.jsp" %>
</body>
</html>
